nice_things/utility/dirname.sh
dirname
Since 0.3.0 · Source
import "{ dirname }" from nice_things/utility/dirname.sh
Synopsisdirname <pathname>
Configuration
–
Description
Print the directory portion of <pathname>, with the last component removed.
This is a pure sh implementation of the dirname utility specified in POSIX.
Being an implementation of a CLI utility, this function prints the result to stdout. If you want to assign the result to a variable, consider using the faster dir_name function instead.
Options
–
Operands<pathname>: A path name.
Stdin
–
Stdout
The resulting pathname is printed to stdout, trailed by a line-feed character.
Stderr
–
Exit status0: Successful completion.
Abort
–
Usage examples
dirname /usr/bin/ # /usr